#!/bin/sh

arg=$*


opt -load ../../../Debug/lib/basicabc.so -basicabc < $arg > temp.bc
#opt -load ../../../Debug/lib/gvnstat.so -gvnstat < temp.bc > /dev/null
opt -mem2reg < temp.bc > a.bc
opt -gvn < a.bc > temp1.bc
opt -load ../../../Debug/lib/ABCD.so -eSSAPass <temp1.bc > b.bc
opt -load ../../../Debug/lib/eSSA.so -eSSAPass2 < b.bc > c.bc
opt -load ../../../Debug/lib/demandPass.so -instructionPass < c.bc > d.bc
